<section class="content-header">
  <!-- <h1>
        年检预警
    </h1> -->
  <ol class="breadcrumb">
    <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
    <li><a class="active">年检预警</a></li>
  </ol>
</section>
<section class="content">
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">查询条件</h3>
      <div class="box-tools">
        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
          </button>
        </div>
      </div>
    </div>
    <!-- <div class="box-body">
      <div class="row">
        <div class="col-md-4">
          <div class="form-group">
            <label>订单名称</label>
            <input class="form-control" name="name" ng-model="search.name" />
          </div>
        </div>
        <div class="col-md-4">
          <div class="form-group">
            <label>客户名称</label>
            <select ui-select2 class="form-control select2" name="customer_id" allowclear="true" ng-model="search.customer_id" url="Customer/DropDownSearch" paging="true" style="width: 100%;">
            </select>
          </div>
        </div>
        <div class="col-md-4">
          <div class="form-group">
            <label>区域</label>
            <select class="form-control select2" name="area" ng-model="search.area">
              <option value="">全部</option>
              <option value="XM">厦门</option>
              <option value="QZ">泉州</option>
              <option value="QD">青岛</option>
            </select>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-4">
          <div class="form-group">
            <label>年检客服</label>
            <select ui-select2 class="form-control select2" name="waiter_id" allowclear="true" ng-view="waiter_name" ng-model="search.waiter_id" url="Member/List" paging="true" style="width: 100%;"></select>
          </div>
        </div>
        <div class="col-md-4">
          <div class="form-group">
            <label>业务员</label>
            <select ui-select2 class="form-control select2" name="salesman_id" allowclear="true" ng-view="salesman" ng-model="search.salesman_id" url="Member/List" paging="true" style="width: 100%;"></select>
          </div>
        </div>
      </div>
    </div>
    <div class="box-footer">
      <a class="btn btn-sm btn-info btn-flat pull-right" ng-click="query()">查询</a>
    </div> -->
    <div class="box-body">
      <div class="row">
        <div class="col-md-3">
          <div class="form-group">
            <input type="text" class="form-control" name="name" ng-model="search.name" placeholder="关键字(档案号、订单名称)">
          </div>
        </div>
        <!-- <div class="col-md-3">
          <div class="form-group">
            <select class="form-control select2" name="area" ng-model="search.area">
              <option value="">全部区域</option>
              <option value="XM">厦门</option>
              <option value="QZ">泉州</option>
              <option value="QD">青岛</option>
            </select>
          </div>
        </div> -->
        <div class="col-md-3">
          <a class="btn btn-sm btn-info btn-flat" ng-click="query()">查询</a>
        </div>
      </div>
    </div>
  </div>
  <div class="box box-danger" style="margin-bottom: 110px;">
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th style="width: 100px">档案号</th>
            <!-- <th style="width: 80px">订单类型</th> -->
            <th style="max-width: 100px">名称</th>
            <th style="width:70px;">注册地</th>
            <th style="width: 100px">最近联系日</th>
            <th style="width: 100px">待办日</th>
            <th style="width: 100px">年检基准日</th>
            <th style="width: 80px">上次年检</th>
            <th style="width: 80px">超期(月)</th>
            <th style="width: 85px">业务员</th>
            <th style="width: 85px">年检客服</th>
            <th class="opt-col" style="width: 100px">操作</th>
          </tr>
          <tr ng-repeat="item in data.items">
            <td ng-bind="(($index + 1)+((data.page.current_index-1)*50))+'.'"></td>
            <td ng-bind="item.order_code"></td>
            <!-- <td ng-bind="item.order_type_name"></td> -->
            <td ng-bind="item.order_name" ng-attr-title="{{item.order_name}}"></td>
            <td ng-bind="item.region"></td>
            <td ng-bind="format(item.date_last, 'YYYY-MM-DD')" ng-attr-title="{{item.title_last}}"></td>
            <td ng-bind="format(item.date_wait, 'YYYY-MM-DD')"></td>
            <!-- <td ng-bind="format(item.date_setup, 'YYYY-MM-DD')"></td> -->
            <td ng-bind="item.setup_day"></td>
            <td ng-bind="item.annual_year"></td>
            <td ng-bind="getMonth(item)" ng-class="{'red-warning': getRedWarning(item)}"></td>
            <td ng-bind="item.saleman"></td>
            <td ng-bind="item.waiter"></td>
            <td class="opt-col">
              <div class="btn-group">
                <button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown">
                  <i class="fa fa-wrench"></i>
                </button>
                <ul class="dropdown-menu" role="menu">
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'annual')" ng-if="opers.indexOf(5) > -1"> 马上年检</a>
                  </li>
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'out')" ng-if="opers.indexOf(5) > -1 && item.order_type == 'reg_abroad'"> 转出</a>
                  </li>
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'not_annual')" ng-if="opers.indexOf(5) > -1 && item.order_type == 'reg_abroad'"> 暂不年检</a>
                  </li>
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'expulsion')" ng-if="opers.indexOf(5) > -1 && item.order_type == 'reg_abroad'"> 除名</a>
                  </li>
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'dismiss')" ng-if="opers.indexOf(5) > -1 && item.order_type == 'reg_abroad'"> 辞退秘书</a>
                  </li>
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'for_sale')" ng-if="opers.indexOf(5) > -1"> 待售</a>
                  </li>
                  <li class="divider"></li>
                  <li>
                    <a href="javascript:;" ng-click="new_annual(item, 'log')" ng-if="opers.indexOf(5) > -1"> 日志</a>
                  </li>
                  <li>
                    <a href="javascript:;" ng-if="opers.indexOf(5) == -1"> 无年检权限</a>
                  </li>
                </ul>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="box-footer clearfix">
      <div pagination page-data="data.page" page-click="go(idx)"></div>
    </div>
  </div>
</section>
<div ui-view="modal"></div>
